<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>使用layout布局</title>
		<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js"></script>
		<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css" />
		<link rel="stylesheet" href="../js/easyui/themes/icon.css"/>
		<!--引入ztree的js-->
		<script type="text/javascript" src="../js/ztree/jquery.ztree.all-3.5.js" ></script>
		<link rel="stylesheet" href="../js/ztree/zTreeStyle.css" />
		<script type="text/javascript">
			$(function(){
				//进行ztree菜单的设置
				var setting={
					data:{
						simpleData:{
							enable:true
						}
					},
					callback:{
						onClick:function(event,treeId,treeNode,clickFlag){
							
							var content = '<div style="width:100%;height:100%;overflow:hidden;">'
								+ '<iframe src="'
								+ treeNode.page
								+ '" scrolling="auto" style="width:100%;height:100%;border:0;" ></iframe></div>';
							//加载选项卡
							if(treeNode.page!=undefined&&treeNode.page!=""){
								if($("#mytabs").tabs('exists',treeNode.name)){
									$("#mytabs").tabs('select',treeNode.name);
								}else{
									$("#mytabs").tabs('add',{
										title:treeNode.name,
										content:content,
										closable:true
									});
								}
							}
						}
					}
				};
				//提供ztree的树形菜单的数据
				var zNodes=[
					{id:1,pId:0,name:"父节点1"},
					{id:11,pId:1,name:"子节点1"},
					{id:12,pId:1,name:"子节点2"},
					{id:2,pId:0,name:"父节点2"},
					{id:21,pId:2,name:"子节点3",page:"https://www.baidu.com"},
					{id:22,pId:2,name:"子节点4",page:"https://www.baidu.com"}
				];
				//生成菜单
				$.fn.zTree.init($("#baseMenu"),setting,zNodes);
			});
		</script>
	</head>

	<body class="easyui-layout">
		<div data-options="region:'north',title:'bos2.0管理系统'" style="height: 100px;">上部区域</div>
		<div data-options="region:'west'" style="width: 180px;">
			<!--左边需要一个折叠项-->
			<div class="easyui-accordion" data-options="fit:true">
				<div data-options="title:'基本菜单'">
					<!--ztree的菜单-->
					<ul id="baseMenu" class="ztree"></ul>
				</div>
				<div data-options="title:'系统菜单'">面板二</div>				
			</div>
		</div>
		<div data-options="region:'center'">
			<!-- 中心部分的选项卡-->
			<div class="easyui-tabs" data-options="fit:true" id="mytabs">
				<div data-options="title:'百度首页',closable:true">
					<a href="javascript:void(0)" id="aaa" style="color: red;">点击进入百度首页</a>
				</div>
				<div data-options="title:'新浪 首页'"></div>
			</div>
		</div>
		<div data-options="region:'east'" style="width: 80px;">东部区域</div>
		<div data-options="region:'south'" style="height: 80px;">我是 页脚</div>

	</body>

</html>